To subject flexible, upwardly unclosed bags to the necessary treatment steps, such as shaping the filling opening, filling the bags with filling material and subsequent closing, so-called in-line indexing machines are used. The bags are guided in receiving elements past the treatment stations, with a plurality of bags being simultaneously treated in different treatment stations. The weight of the bags is supported in known machines on the bottom surface of the receiving containers, i.e., the bags are transported in an upright position. Stationary means or mechanical means which are arranged on the receiving containers are used for opening a bag and for closing, sealing or welding the bag after it has been filled. To carry out these functions in a safe and reliable manner, known machines have a complicated structure. Furthermore, it is very troublesome to handle the necessary mechanical elements and to remove the bags from the outside from the receiving containers. Since the weight of the bags is supported from below, the bag walls must have a certain stiffness and thus a specific material thickness which must be the higher the greater the bags are.